//---------------------------------------Ajax functions
//---submit fur fur ADD
function submitform(formid,pagename)
{
         if (formid.length==0)
         {
                return;
         }
         if (window.XMLHttpRequest)
         {// code for IE7+, Firefox, Chrome, Opera, Safari
             xmlhttp=new XMLHttpRequest();
         }
         else
         {// code for IE6, IE5
             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
         xmlhttp.onreadystatechange=function()
         {
           if (xmlhttp.readyState==4 && xmlhttp.status==200)
           {
              document.getElementById(formid).innerHTML=xmlhttp.responseText;
           }
         }
         var str="";
         myform=document.getElementById(formid);
         for(var i=0; i < myform.length;i++){
             if((myform.elements[i].type=="text" || myform.elements[i].type=="select-one" || myform.elements[i].type=="textarea") && myform.elements[i].name!=""){
                 if(str!="")  str=str+"&";
                 str=str+myform.elements[i].name+"="+myform.elements[i].value;
             }else {
                //alert(myform.elements[i].type);
             }
         }
         if(str!="")str="?"+str;
         //alert(pagename+str);
         xmlhttp.open("GET",pagename+str,true);
         xmlhttp.send();
}
